home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / etc / bash_completion.d / monodevelop < prev    next >
Text File  |  2009-04-02  |  2KB  |  98 lines

  1. # -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
  2. # ex: ts=8 sw=8 noet filetype=sh
  3. #
  4. # Monodevelop completion
  5. #
  6. have monodevelop &&
  7. _monodevelop()
  8. {
  9.     local cur
  10.     cur=`_get_cword`
  11.     
  12.     if [[ "$cur" == -* ]]; then
  13.         COMPREPLY=( $( compgen -W '-? -help \
  14.                                     -help2 \
  15.                                     -ipc-tcp \
  16.                                     -newwindow \
  17.                                     -nologo \
  18.                                     -usage \
  19.                                     -V -version' -- "$cur" ) )
  20.     else
  21.         _filedir
  22.     fi
  23.     return 0
  24. } &&
  25. complete -F _monodevelop monodevelop
  26.  
  27. have mdtool &&
  28. _mdtool()
  29. {
  30.     local cur prev command i
  31.  
  32.     COMPREPLY=()
  33.  
  34.     cur=`_get_cword`
  35.     prev=${COMP_WORDS[COMP_CWORD-1]}
  36.     
  37.     for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
  38.         if [[ ${COMP_WORDS[i]} == @(build|generate-makefiles|setup) ]]; then
  39.             command=${COMP_WORDS[i]}
  40.         fi
  41.     done
  42.  
  43.     if [[ -n "$command" ]]; then
  44.         case $command in
  45.             "build")
  46.                 COMPREPLY=( $( compgen -W '--f --buildfile --p --project' -S":" -- "$cur" ) )
  47.                 # TODO: This does not work :(
  48.                 #if [[ "$prev" == *: ]]; then
  49.                 #    case "$prev" in
  50.                 #        @(--p:|--project:))
  51.                 #            COMPREPLY=( $( compgen -f -G "*.mdp" -- "$cur" ) )
  52.                 #            ;;
  53.                 #        @(--f:|--buildfile:))
  54.                 #            COMPREPLY=( $( compgen -f -G "*.mdp" -G "*.mds" -- "$cur" ) )
  55.                 #            ;;
  56.                 #    esac
  57.                 #fi
  58.                 return 0
  59.                 ;;
  60.             "generate-makefiles")
  61.                 COMPREPLY=( $( compgen $filenames -G"*.mds" -- "$cur" ) )
  62.                 if [[ "$prev" == *mds ]]; then
  63.                     COMPREPLY=( $( compgen -W '--simple-makefiles --s --d:' -- "$cur" ) )
  64.                 fi
  65.                 return 0
  66.                 ;;
  67.             "setup")
  68.                 # TODO: at least return filenames after these options.
  69.                 COMPREPLY=( $( compgen -W 'install i \
  70.                                             uninstall u \
  71.                                             check-install ci \
  72.                                             update up \
  73.                                             list l \
  74.                                             list-av la \
  75.                                             list-update lu \
  76.                                             rep-add ra \
  77.                                             rep-remove rr \
  78.                                             rep-update ru \
  79.                                             rep-list rl \
  80.                                             reg-update reg-build rgu \
  81.                                             info \
  82.                                             rep-build rb \
  83.                                             pack p \
  84.                                             help h \
  85.                                             dump-file' -- "$cur" ) )
  86.                 return 0
  87.                 ;;
  88.         esac
  89.     fi
  90.     
  91.     COMPREPLY=( $( compgen -W 'gsetup build dbgen project-export \
  92.                                 generate-makefiles gettext-update \
  93.                                 setup -q' -- "$cur" ) )
  94.     
  95.     return 0
  96. } &&
  97. complete -F _mdtool $filenames mdtool
  98.